Add BABEL method (ATAC->GEX prediction) - #19
Conversation
Ports BABEL (Wu et al. 2021, PNAS) as a train/predict method pair for predicting RNA expression from scATAC-seq accessibility. Uses a dense RNA encoder/decoder and a chromosome-split ATAC encoder/decoder, trained jointly with a negative binomial loss for RNA and BCE for binarized ATAC accessibility. Verified end-to-end via viash run against real bmmc_multiome/swap data (Docker build, training, prediction): 0.34 mean per-cell correlation with ground truth, in line with the existing knnr_py baseline on the same data.As BABEl is not installable in its original implmentation, code was rewritten here.
Add info.test_setup + test_resources overrides pointing both components at bmmc_multiome/swap (mod1=ATAC, the ATAC->GEX direction), matching how scbutterfly/novel/simple_mlp wire their tests. babel_predict reuses the pre-trained model committed under models/babel, and babel_train uses nn_epochs=2 for a fast test. Verified: viash test passes for both babel_train (2/2) and babel_predict (2/2).
|
Ran BABEL on a de.NBI Tesla T4. Two blockers, one of which only shows up on a GPU and so can't be caught by CI or by local CPU testing. 1. Not registered at all -- it would silently never run
The build stays green, 2. Training crashes on a GPU -- device mismatch
device="cuda" if torch.cuda.is_available() else "cpu",puts the module and its predictions on This cannot reproduce on CPU -- there every tensor is on Worth noting it is a real GPU path -- the model does move to the device and allocates 169 MiB -- it's a device-handling bug, not a silent CPU fallback. 3. The published method id would be
|
* Add babel to run_benchmark's dependencies and methods list -- it was in neither, so it built green, tested green, and silently never ran * Move y_true onto the model's device in BabelNet.get_loss. skorch.NeuralNet.get_loss does this; the override dropped it, so on a GPU the targets stayed on CPU and the NB loss raised a device mismatch. Verified on a T4: train and predict both use the GPU now * Report "babel" as the method id rather than babel_predict
# Conflicts: # src/workflows/run_benchmark/config.vsh.yaml # src/workflows/run_benchmark/main.nf
Ports BABEL (Wu et al. 2021, PNAS) as a train/predict method pair for predicting RNA expression from scATAC-seq accessibility. Uses a dense RNA encoder/decoder and a chromosome-split ATAC encoder/decoder, trained jointly with a negative binomial loss for RNA and BCE for binarized ATAC accessibility.
Verified end-to-end via viash run against real bmmc_multiome/swap data (Docker build, training, prediction): 0.34 mean per-cell correlation with ground truth, in line with the existing knnr_py baseline on the same data.As BABEl is not installable in its original implmentation, code was rewritten here.
Describe your changes
Checklist before requesting a review
I have performed a self-review of my code
Check the correct box. Does this PR contain:
Proposed changes are described in the CHANGELOG.md
CI Tests succeed and look good!